package com.mate.cloud.auth.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.SecurityFilterChain;

/**
 * 授权服务AuthorizationServerConfig配置
 *
 * @author: MI
 * @email: 448341911@qq.com
 * @createTime: 2024/6/14 18:11
 * @updateUser: MI
 * @updateTime: 2024/6/14 18:11
 * @updateRemark: 修改内容
 * @version: v1.0
 */
@Slf4j
@Configuration
public class AuthorizationServerConfig {


    //滤器链的相关设置
    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http.authorizeHttpRequests(authorize -> authorize.anyRequest().authenticated())
                .formLogin(e -> e.defaultSuccessUrl("/hello",true).permitAll());
        return http.build();
    }

}



